package com.tuanzi.loan.business.entity.system;

import javax.persistence.*;
import javax.validation.constraints.NotNull;

import org.hibernate.annotations.GenericGenerator;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotBlank;

import com.tuanzi.loan.core.entity.BaseEntity;

import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * 职责：定时任务类
 * 
 * @author chenxf
 * @since 2015-4-27
 */
@Data
@Entity
@Table(name = "TB_LOAN_SCHEDULE")
@EqualsAndHashCode(callSuper = true)
public class Schedule extends BaseEntity {

	private static final long serialVersionUID = 1236130510086083224L;

	@Id
	@Column(name = "ID")
	@GeneratedValue(generator = "uuid2")
	@GenericGenerator(name = "uuid2", strategy = "org.hibernate.id.UUIDGenerator")
	private String id;

	@NotBlank
	@Length(max = 255)
	@Column(name = "TASK_NAME")
	private String taskName;

	@NotNull
	@Column(name = "TASK_GROUP")
	private String taskGroup;

	@Column(name = "TASK_CLS")
	private String taskCls;

	@Column(name = "SCRIPT")
	private String script;

	@NotNull
	@Column(name = "EXECUTE_TYPE")
	private Integer executeType;

	@NotNull
	@Column(name = "START_TYPE")
	private Integer startType;

	@NotBlank
	@Length(max = 255)
	@Column(name = "CRON")
	private String cron;

}
